{% macro menu_links(allMenu, pid) %}
    {% if allMenu[pid] is defined %}
        <ol class="dd-list">
            {% for menu in allMenu[pid] %}
                {#dd-collapsed#}
                <li class="dd-item dd-collapsed" data-id="{{ menu.id }}">
                    <div class="dd-handle">
                        <i class="{{ menu.style|default('') }}"></i>&nbsp;<strong>{{ menu.name }}</strong>&nbsp;&nbsp;&nbsp;
                        {% if menu.url!="" and menu.isAccess==0 %}<a href="{{ path(menu.url) }}" class="dd-nodrag">{{ path(menu.url) }}</a>{% endif %}
                        <span class="font-weight-lighter"> {{ menu.descr }}</span>
                        {% if menu.isLock %}
                            <span class="right badge badge-secondary dd-nodrag tip" title="已锁定，不能修改">
                  <i class="mdi mdi-lock"></i>
                </span>
                        {% endif %}
                        {% if menu.isAccess %}
                            <span class="right badge badge-success dd-nodrag tip" title="对象为权限,导航上不会显示">
                <i class="mdi mdi-key"></i>
            </span>
                        {% endif %}
                        {% if menu.isLock == 0 %}
                            <span class="pull-right dd-nodrag">
                              {% if is_authorized('admin_menu_view') %}
                                <a href="{{ path("admin_menu_view", {"id":menu.id}) }}" data-title="查看"  class="mypoppage"><i class="mdi mdi-eye"></i></a>
                              {% endif %}

                              {% if is_authorized('admin_menu_edit') %}
                                  <a href="{{ path("admin_menu_edit", {"id":menu.id}) }}" data-title="编辑"  class="mypoppage"><i class="mdi mdi-file-document-edit"></i></a>
                              {% endif %}

                              {% if is_authorized('admin_api_menu_delete') %}
                                  <a href="{{ path("admin_api_menu_delete", {"id":menu.id}) }}"  data-confirm="确认要删除吗?" class="tree_branch_delete ajaxDelete"><i class="mdi mdi-delete"></i></a>
                              {% endif %}
                            </span>
                        {% endif %}
                    </div>
                    {{ _self.menu_links(allMenu, menu.id) }}
                </li>
            {% endfor %}
        </ol>
    {% endif %}
{% endmacro %}
